import redis
import logging
class Config(object):
    """配置工程信息"""
    SECRET_KEY = "EjpNVSNQTyGi1VvWECj9TvC/+kq3oujee2kTfQUs8yCM6xX9Yjq52v54g+HVoknA"

    DEBUG = False
    # mysql
    SQLAlchemy_DATABASE_URI = 'mysql://root:mysql@127.0.0.1:3306/information'
    SQLAlchemy_TRACK_MODIFICATIONS = False
    # redis
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379
    # flask_session
    # SECRET_KEY = "EjpNVSNQTyGi1VvWECj9TvC/+kq3oujee2kTfQUs8yCM6xX9Yjq52v54g+HVoknA"
    SESSION_TYPE = "redis"
    # cookie 中的session_id被加密签名处理
    SESSION_USE_SIGNER = True
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    # SESSION的有效期
    PERMANENT_SESSION_LIFETIME = 86400
    # LOG_LEVEL = logging.DEBUG

class DevelopementConfig(Config):
    """dev"""
    DEBUG = True

class ProductionConfig(Config):
    """pro"""
    pass

config = {
    'development': DevelopementConfig,
    'production': ProductionConfig
}